import request from "@/utils/request";
import { stringify } from "qs";

//获取列表分页
export async function getOutboundorderPage(params) {
	return request(`/new-wms/outboundorder/page`, {
		method: "Post",
		data: params,
		loading: true
	});
}

//获取统计数量
export async function getOutboundorderStatistics(params) {
	return request(`/new-wms/outboundorder/statistics?${stringify(params)}`);
}

//导出出库单
export async function exportOutbound(params) {
	return request(`/new-wms/outboundorder/export-outbound`, {
		method: "Post",
		data: params,
		getResponse: true,
		responseType: "blob",
		loading: true
	});
}

//手动发货
export async function outBoundOrderManualDelivery(params) {
	return request(`/new-wms/outboundorder/manual-delivery`, {
		method: "Post",
		data: params,
		loading: true
	});
}

//合格证批量打印
export async function batchPrintByQualifiedOutbound(params) {
	return request(`/new-wms/outboundorder/batch-print-by-qualified`, {
		method: "Post",
		data: params
	});
}
//快递批量打印
export async function batchPrintExpressByQualifiedOutbound(params) {
	return request(`/new-wms/outboundorder/batch-print-by-express`, {
		method: "Post",
		data: params
	});
}
// 快递批量打印成功通知
export async function batchPrintByExpressSuccessNotify(params) {
	return request(`/new-wms/outboundorder/batch-print-by-express-success-notify`, {
		method: "Post",
		data: params
	});
}

export async function getCoFcTemplateByIdsOutbound(params) {
	return request(`/new-wms/outboundorder/get-co-fc-template-byIds`, {
		method: "Post",
		data: params
	});
}

//商品详情
export async function queryPageDetail(params) {
	return request(`/zjf-wms/refundStorage/detail?${stringify(params)}`);
}

//查询自定义标签
export async function queryLabels(params) {
	return request(`/zjf-oms/order/rule/label/search?${stringify(params)}`);
}
//新增常用地址
export async function addCommonuseaddress(params) {
	return request("/blade-user/commonuseaddress/save", {
		method: "post",
		data: params
	});
}

//常用地址列表
export async function queryCommonuseaddressList(params) {
	return request(`/blade-user/commonuseaddress/list?${stringify(params)}`);
}

//删除常用地址
export async function delCommonuseaddress(params) {
	return request("/blade-user/commonuseaddress/remove", {
		method: "post",
		//   data: params,
		body: toFormData(params)
	});
}
// 平台网店列表
export async function getShopListOp(params) {
	return request(`/blade-goods/ecstore/list/page?${stringify(params)}`);
}
//仓库列表(普通)
export async function getWareHouseList(params) {
	return request(`/zjf-wms/warehouse/networkCanUseWarehouseList?${stringify(params)}`);
}
//获取奇门店铺列表
export async function queryQImenStoreList(params) {
	// return request(`/blade-goods/jushuitanstore/list?${stringify(params)}`);
	return request(`192.168.124.31:8882/`);
}
//查看可选区域
export async function getCanSelectArea(params) {
	return request(`/blade-logistics/area/notIn`, {
		body: func.toFormData(params),
		method: "post"
	});
}
// 手动发货
export async function manualDelivery(params) {
	return request(`/zjf-wms/df/weight/alweight`, {
		method: "POST",
		body: Func.toFormData(params)
	});
}

export async function updateOutboundRemark(params) {
	return request(`/new-wms/outboundorder/update-outbound-remark`, { method: "POST", data: params, loading: true });
}
// 获取店铺列表
export async function queryStoreList(params) {
	return request(`/blade-goods/newSystem/ecStore/list/page`, {
		method: "POST",
		data: params
	});
}
// 是否可以手动发货
export async function isManualDelivery(data) {
	return request(`/new-wms/outboundorder/is-manual-delivery`, {
		method: "POST",
		data: data
	});
}
//获取异常原因-所有
export async function getErrorReason() {
	return request(`/new-common/errorConfig/list`);
}

// 获取合格证打印模板
export async function getOutboundNoCertificatePrintData(data) {
	return request(`/new-wms/kuaimai/getOutboundNoCertificatePrintData`, {
		method: "POST",
		data: data
	});
}

//获取发货设置
export async function getShippingConfigList() {
	return request(`/new-wms/sortingvoiceconfiguration/getShippingConfigList`);
}
